home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _dmlang.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  11KB  |  349 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDayMonth 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Days and months in different language"
  5.    ClientHeight    =   5025
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   9000
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   5025
  13.    ScaleWidth      =   9000
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   9000
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   8640
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   7740
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   8100
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   6285
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.TextBox txt_Result 
  65.       BackColor       =   &H00C0C0C0&
  66.       BorderStyle     =   0  'None
  67.       Height          =   4290
  68.       Left            =   180
  69.       Locked          =   -1  'True
  70.       MultiLine       =   -1  'True
  71.       ScrollBars      =   2  'Vertical
  72.       TabIndex        =   0
  73.       Top             =   630
  74.       Width           =   8730
  75.    End
  76. Attribute VB_Name = "frmDayMonth"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83. Private Const Iteration = 250
  84. Dim IsLoaded         As Integer
  85. Dim TimerStartOk     As Integer
  86. Dim TimerCloseOk     As Integer
  87. Dim TimerHandle      As Integer
  88. Dim TimerValue       As Long
  89. Dim Language(LNG_FRENCH To LNG_SWEDISH) As String
  90.       
  91. Private Sub cmdNP_Click(Index As Integer)
  92.    Call sub_NextPrev(cmb_Function, Index)
  93. End Sub
  94. Private Sub cmb_Function_Click()
  95.    If (IsLoaded = False) Then Exit Sub
  96.    Call cDisableFI(mdiT2W.Picture1)
  97.    txt_Result = ""
  98.    DoEvents
  99.    Select Case cmb_Function.ListIndex
  100.       Case 0
  101.          Call TestAscTime
  102.       Case 1
  103.          Call TestTinyDay
  104.       Case 2
  105.          Call TestSmallDay
  106.       Case 3
  107.          Call TestShortDay
  108.       Case 4
  109.          Call TestLongDay
  110.       Case 5
  111.          Call TestTinyMonth
  112.       Case 6
  113.          Call TestShortMonth
  114.       Case 7
  115.          Call TestLongMonth
  116.    End Select
  117.    DoEvents
  118.    Call cEnableFI(mdiT2W.Picture1)
  119. End Sub
  120. Private Sub Form_Activate()
  121.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  122. End Sub
  123. Private Sub Form_Load()
  124.    IsLoaded = False
  125.    Show
  126.    Call FillLanguage(Language())
  127.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_dmlang.t2w")
  128.    IsLoaded = True
  129. End Sub
  130. Private Sub Command1_Click()
  131.    Call cmb_Function_Click
  132. End Sub
  133. Private Sub TestAscTime()
  134.    Dim intResult        As Integer
  135.    Dim strResult        As String
  136.    Dim strDisplay       As String
  137.    Dim i                As Integer
  138.    intResult = 0
  139.    strResult = ""
  140.    strDisplay = ""
  141.       
  142.    For i = LNG_FRENCH To LNG_SWEDISH
  143.       strDisplay = strDisplay + Language(i) + cGetAscTime(i) + vbCrLf + vbCrLf
  144.    Next i
  145.    txt_Result = strDisplay
  146.    'time the function
  147.    TimerHandle = cTimerOpen()
  148.    TimerStartOk = cTimerStart(TimerHandle)
  149.    For i = 1 To Iteration
  150.       strResult = cGetAscTime(LNG_FRENCH)
  151.    Next i
  152.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  153.    TimerCloseOk = cTimerClose(TimerHandle)
  154. End Sub
  155. Private Sub TestTinyDay()
  156.    Dim intResult        As Integer
  157.    Dim strResult        As String
  158.    Dim strDisplay       As String
  159.    Dim i                As Integer
  160.    Dim j                As Integer
  161.    intResult = 0
  162.    strResult = ""
  163.    strDisplay = ""
  164.    For i = LNG_FRENCH To LNG_SWEDISH
  165.       strDisplay = strDisplay + Language(i)
  166.       For j = 1 To 7
  167.          strDisplay = strDisplay + cGetTinyDay(i, j) + " "
  168.       Next j
  169.       strDisplay = strDisplay + vbCrLf + vbCrLf
  170.    Next i
  171.    txt_Result = strDisplay
  172.    'time the function
  173.    TimerHandle = cTimerOpen()
  174.    TimerStartOk = cTimerStart(TimerHandle)
  175.    For i = 1 To Iteration
  176.       strResult = cGetTinyDay(LNG_FRENCH, 1)
  177.    Next i
  178.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  179.    TimerCloseOk = cTimerClose(TimerHandle)
  180. End Sub
  181. Private Sub FillLanguage(arrLanguage() As String)
  182.    arrLanguage(LNG_FRENCH) = "French : "
  183.    arrLanguage(LNG_DUTCH) = "Dutch : "
  184.    arrLanguage(LNG_GERMAN) = "German : "
  185.    arrLanguage(LNG_ENGLISH) = "English : "
  186.    arrLanguage(LNG_ITALIAN) = "Italian : "
  187.    arrLanguage(LNG_SPANISH) = "Spanish : "
  188.    arrLanguage(LNG_CATALAN) = "Catalan : "
  189.    arrLanguage(LNG_POLISH) = "Polish : "
  190.    arrLanguage(LNG_NORWAY) = "Norway : "
  191.    arrLanguage(LNG_SWEDISH) = "Swedish : "
  192. End Sub
  193. Private Sub TestSmallDay()
  194.    Dim intResult        As Integer
  195.    Dim strResult        As String
  196.    Dim strDisplay       As String
  197.    Dim i                As Integer
  198.    Dim j                As Integer
  199.    intResult = 0
  200.    strResult = ""
  201.    strDisplay = ""
  202.    For i = LNG_FRENCH To LNG_SWEDISH
  203.       strDisplay = strDisplay + Language(i)
  204.       For j = 1 To 7
  205.          strDisplay = strDisplay + cGetSmallDay(i, j) + " "
  206.       Next j
  207.       strDisplay = strDisplay + vbCrLf + vbCrLf
  208.    Next i
  209.    txt_Result = strDisplay
  210.    'time the function
  211.    TimerHandle = cTimerOpen()
  212.    TimerStartOk = cTimerStart(TimerHandle)
  213.    For i = 1 To Iteration
  214.       strResult = cGetSmallDay(LNG_FRENCH, 1)
  215.    Next i
  216.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  217.    TimerCloseOk = cTimerClose(TimerHandle)
  218. End Sub
  219. Private Sub TestLongDay()
  220.    Dim intResult        As Integer
  221.    Dim strResult        As String
  222.    Dim strDisplay       As String
  223.    Dim i                As Integer
  224.    Dim j                As Integer
  225.    intResult = 0
  226.    strResult = ""
  227.    strDisplay = ""
  228.    For i = LNG_FRENCH To LNG_SWEDISH
  229.       strDisplay = strDisplay + Language(i)
  230.       For j = 1 To 7
  231.          strDisplay = strDisplay + cGetLongDay(i, j) + " "
  232.       Next j
  233.       strDisplay = strDisplay + vbCrLf + vbCrLf
  234.    Next i
  235.    txt_Result = strDisplay
  236.    'time the function
  237.    TimerHandle = cTimerOpen()
  238.    TimerStartOk = cTimerStart(TimerHandle)
  239.    For i = 1 To Iteration
  240.       strResult = cGetLongDay(LNG_FRENCH, 1)
  241.    Next i
  242.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  243.    TimerCloseOk = cTimerClose(TimerHandle)
  244. End Sub
  245. Private Sub TestShortDay()
  246.    Dim intResult        As Integer
  247.    Dim strResult        As String
  248.    Dim strDisplay       As String
  249.    Dim i                As Integer
  250.    Dim j                As Integer
  251.    intResult = 0
  252.    strResult = ""
  253.    strDisplay = ""
  254.    For i = LNG_FRENCH To LNG_SWEDISH
  255.       strDisplay = strDisplay + Language(i)
  256.       For j = 1 To 7
  257.          strDisplay = strDisplay + cGetShortDay(i, j) + " "
  258.       Next j
  259.       strDisplay = strDisplay + vbCrLf + vbCrLf
  260.    Next i
  261.    txt_Result = strDisplay
  262.    'time the function
  263.    TimerHandle = cTimerOpen()
  264.    TimerStartOk = cTimerStart(TimerHandle)
  265.    For i = 1 To Iteration
  266.       strResult = cGetShortDay(LNG_FRENCH, 1)
  267.    Next i
  268.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  269.    TimerCloseOk = cTimerClose(TimerHandle)
  270. End Sub
  271. Private Sub TestTinyMonth()
  272.    Dim intResult        As Integer
  273.    Dim strResult        As String
  274.    Dim strDisplay       As String
  275.    Dim i                As Integer